[#assign loginUser = s_user]
[#assign globalConfig = systemConfig()]

[#macro header _title=""]
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>[#if _title?has_content]${_title} -- [/#if]${(globalConfig.title)?has_content?string(globalConfig.title,"LMaster")}</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <link rel="stylesheet" href="${base}/res/components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="${base}/res/components/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="${base}/res/components/Ionicons/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="${base}/res/dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
        page. However, you can choose any other skin. Make sure you
        apply the skin class to the body tag so the changes take effect. -->
  <link rel="stylesheet" href="${base}/res/dist/css/skins/skin-blue.min.css">
  <link rel="stylesheet" href="${base}/res/components/toastr/toastr.min.css">
  <link rel="stylesheet" href="${base}/res/css/lmaster.css">
  <link rel="stylesheet" href="${base}/res/plugins/pace/pace.min.css">
  <script src="${base}/res/components/jquery/dist/jquery.min.js"></script>
  <script type="text/javascript" src="${base}/res/plugins/pace/pace.min.js"></script>

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
[#nested ]
</head>
[/#macro]

[#macro body menu=""]

[#--
<!--
BODY TAG OPTIONS:
=================
Apply one or more of the following classes to get the
desired effect
|---------------------------------------------------------|
| SKINS         | skin-blue                               |
|               | skin-black                              |
|               | skin-purple                             |
|               | skin-yellow                             |
|               | skin-red                                |
|               | skin-green                              |
|---------------------------------------------------------|
|LAYOUT OPTIONS | fixed                                   |
|               | layout-boxed                            |
|               | layout-top-nav                          |
|               | sidebar-collapse                        |
|               | sidebar-mini                            |
|---------------------------------------------------------|
-->
--]
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
  <!-- Main Header -->
  <header class="main-header">
    <!-- Logo -->
    <a href="${base}/master" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini">${(globalConfig.title)?has_content?string(globalConfig.title,"LM")}</span>
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg">${(globalConfig.title)?has_content?string(globalConfig.title,"LMaster")}</span>
    </a>

    <!-- Header Navbar -->
    <nav class="navbar navbar-static-top" role="navigation">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
        <span class="sr-only">Toggle navigation</span>
      </a>
      <!-- Navbar Right Menu -->
      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <!-- User Account Menu -->
          <li class="dropdown user user-menu">
            <!-- Menu Toggle Button -->
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <!-- The user image in the navbar-->
              <img src="${base}${(loginUser.portrait)?has_content?string(loginUser.portrait,"/res/img/user.png")}" class="user-image" alt="User Image">
              <!-- hidden-xs hides the username on small devices so only the image appears. -->
              <span class="hidden-xs">${loginUser.nickName?html}</span>
            </a>
            <ul class="dropdown-menu">
              <!-- The user image in the menu -->
              <li class="user-header">
                <img src="${base}${(loginUser.portrait)?has_content?string(loginUser.portrait,"/res/img/user.png")}" class="img-circle" alt="User Image">

                <p>
                  ${loginUser.nickName?html}
                  [#--<small>Member since Nov. 2012</small>--]
                </p>
              </li>
              <!-- Menu Footer-->
              <li class="user-footer">
                [#-- <div class="pull-left">
                  <a href="${base}/open/profile/" class="btn btn-default btn-flat">个人资料</a>
                </div> --]
                <div class="pull-right">
                  <a href="${base}/logout" class="btn btn-default btn-flat">退出</a>
                </div>
              </li>
            </ul>
          </li>
        </ul>
      </div>
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">

    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">

      <!-- Sidebar user panel (optional) -->
      <div class="user-panel">
        <div class="pull-left image">
          <img src="${base}${(loginUser.portrait)?has_content?string(loginUser.portrait,"/res/img/user.png")}" class="img-circle" alt="User Image">
        </div>
        <div class="pull-left info">
          <p>${loginUser.nickName?html}</p>
          <!-- Status -->
          <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
        </div>
      </div>

      <!-- Sidebar Menu -->
      <ul class="sidebar-menu" data-widget="tree" id="leftMenu">
        <li class="header">功能导航</li>
        <li>
            <a href="${base}/master/password"><i class="fa fa-lock"></i>
                <span class="">修改密码</span>
            </a>
        </li>
        [#-- <li class="treeview">
            <a href="#"><i class="fa fa-user"></i>
                <span class="">用户中心</span>
                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
            </a>
            <ul class="treeview-menu">
                <li>
                    <a href="${base}/master/profile"><i class="fa fa-user-o"></i>
                        <span class="">个人资料</span>
                    </a>
                </li>
                <li>
                    <a href="${base}/master/password"><i class="fa fa-lock"></i>
                        <span class="">修改密码</span>
                    </a>
                </li>
            </ul>
        </li> --]
        [@menuItem userMenuTree() /]
      </ul>
      <!-- /.sidebar-menu -->
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    [#nested ]
  </div>
  <!-- /.content-wrapper -->

  <!-- Main Footer -->
  <footer class="main-footer">
    [#-- <!-- To the right -->
    <div class="pull-right hidden-xs">
      Anything you want
    </div> --]
    <!-- Default to the left -->
    <strong>Copyright &copy; 2018 <a href="#">苍穹跃龙</a>.</strong> All rights reserved.
  </footer>
</div>
<!-- ./wrapper -->

<!-- REQUIRED JS SCRIPTS -->

<!-- Bootstrap 3.3.7 -->
<script src="${base}/res/components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="${base}/res/dist/js/adminlte.min.js"></script>
<script src="${base}/res/components/toastr/toastr.min.js"></script>
<script src="${base}/res/components/bootbox/bootbox.min.js"></script>
<script type="text/javascript">var root='${base}'</script>
<script src="${base}/res/js/base.js"></script>

<!-- Optionally, you can add Slimscroll and FastClick plugins.
     Both of these plugins are recommended to enhance the
     user experience. -->
</body>
</html>
[/#macro]
[#macro footer][/#macro]
[#macro breadcrumb _location...]
<section class="content-header">
  <h1>
    ${_location?last}
[#--     <small>Optional description</small> --]
  </h1>
  <ol class="breadcrumb">
    <li><a href="${base}"><i class="fa fa-dashboard"></i> 首页</a></li>
    [#list _location as _name]
    <li class="active">${_name}</li>
    [/#list]
  </ol>
</section>
[/#macro]

[#macro menuItem menuList]
[#list menuList as m]
    <li [#if m.children?has_content]class="treeview"[/#if]>
        <a href="${m.menuType?switch("inner", base+m.url, "out", m.url, "#")}">
            [#if m.icon?has_content]<i class="${m.icon}"></i>[/#if]
            <span class="">${m.name}</span>
            [#if m.children?has_content]<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>[/#if]
        </a>
        [#if m.children?has_content]
        <ul class="treeview-menu">
        [@menuItem m.children /]
        </ul>
        [/#if]
    </li>
[/#list]
[/#macro]